Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (adapted for ngcgui from Chris Radek routine: P-hole.ngc)
- (info: Probe hole, start from approx x,y center)
- o<p-hole> sub
- #<maxradius> = #1 (=4)
- #<zsafe> = #2 (=.1)
- #<feednorm> = #3 (=5)
- #<feedslow> = #4 (=0.05)
- #<probediam> = #5 (=.07874 probe diam)
- #<in_or_mm> = #6 (=21 in:20, mm:21)
- #<offset> = #7 (=0.025)
- #<finaldist> = #8 (=0.10)
- G#<in_or_mm> ; inch or mm
- F#<feednorm>
- G90
- #<xstart>=#5420
- #<ystart>=#5421
- G91 G38.3 Z0.001 ; establish initial xcenter,ycenter with noerror probe move
- ;M110 ; clear axis ui notifications
- ; bug in interp_convert.cc prevents mulitple named params with debug,
- ; (debug, start x,y =#<xstart> #<ystart)
- ;(debug, start x,y =#5420,#5421)
- (debug,Probe four times +x,-x,+y,-y at feednorm)
- ;(debug,Then probe again at feedslow)
- ;(debug,Press RESUME to begin)
- M0
- #<xcenter>=#5061
- #<ycenter>=#5062
- G91 G38.2 X#<maxradius> ; incremental +x probe
- #<xplus>=#5061
- G90 G0 X#<xcenter> ; absolute move to xcenter
- G91 G38.2 X[0-#<maxradius>] ; incremental -x probe
- #<xminus>=#5061
- #<xcenter>=[[#<xplus>+#<xminus>]/2] ; new xcenter
- G90 G0 X#<xcenter> ; absolute move to xcenter
- G91 G38.2 Y#<maxradius>
- #<yplus>=#5062
- G90 G0 Y#<ycenter>
- G91 G38.2 Y[0-#<maxradius>]
- #<yminus>=#5062
- #<ycenter>=[[#<yplus>+#<yminus>]/2]
- G90 G0 Y#<ycenter>
- F#<feedslow>
- G90 G0 X[#<xplus>-#<offset>]
- G91 G38.2 X#<finaldist>
- #<xplus>=#5061
- G90 G0 X[#<xminus>+#<offset>]
- G91 G38.2 X-#<finaldist>
- #<xminus>=#5061
- #<xcenter>=[[#<xplus>+#<xminus>]/2]
- G90 G0 X#<xcenter>
- G90 G0 Y[#<yplus>-#<offset>]
- G91 G38.2 Y#<finaldist>
- #<yplus>=#5062
- G90 G0 Y[#<yminus>+#<offset>]
- G91 G38.2 Y-#<finaldist>
- #<yminus>=#5062
- #<ycenter>=[[#<yplus>+#<yminus>]/2]
- G90 G0 Y#<ycenter>
- #<xdia> = [#<xplus>-#<xminus>+#<probediam>]
- #<ydia> = [#<yplus>-#<yminus>+#<probediam>]
- #<dia> = [[#<xdia>+#<ydia>]/2]
- #<angle> = [atan[#<ycenter>]/[#<xcenter>]]
- #<dist> = [sqrt[[#<xcenter>*#<xcenter>]+[#<ycenter>*#<ycenter>]]]
- G0 Z#<zsafe>
- (debug,Xdia=#<xdia> Ydia=#<ydia> Dia=#<dia> Ang=#<angle> Dist=#<dist>)
- (debug,Xcenter=#<xcenter> Ycenter=#<ycenter> Dia=#<dia>)
- o<p-hole> endsub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement